<?php
class Modules_Common_DB_Backlog extends BaseObject
{
	public static function GetTableName() {
        return 'backlog';
    }
    public static function &ById($id) {
        self::GetById($id);
    }
    public function getTasks()
     {
    	$mcdt=new Modules_Common_DB_Tasks();
    	if(count(($ids=$mcdt->GetIds('WHERE BackLog_id="'.Mysql::EscapeString($this->id).'"')))>0)
        	return $mcdt->GetByIds($ids);
        else
        	return array();
    }
	 public  function getUserStories()
	    {
	    	$mcdt=new Modules_Common_DB_Userstories();
	    	if(count(($ids=$mcdt->GetIds('WHERE BackLog_id="'.Mysql::EscapeString($this->id).'"')))>0)
	        	return $mcdt->GetByIds($ids);
	        else
	        	return array();
	 }
	public function addTasks($text)
	{
		$data=array(
			"Backlog_id"=>$this->id,
					
		);
		self::AddRecords($data,Tasks::GetTableName());
	}
	public function addUserStories($text)
	{
				$data=array(
				"Backlog_id"=>$this->id,
					
		);
		self::AddRecords($data,UserStories::GetTableName());
	}
	 
}
?>